NOTE: This is beta software and, while every effort has been made to assure that it is free of bugs, some may still exist and I assume no responsibility for any problems or down time that the program or any bugs thereof may cause, directly or indirectly.
Executive Summary
-----------------
• Save window positions in THINK C.
• Mark functions in source files.
• Drop “Marker Control” onto your System Folder and restart.
Open the “Marker Control” control panel to configure its operation.
• Run THINK C and notice the difference.
- Window positions are saved (open a file, move its window,
close it, reopen it to try this out)
- Command-click on the title bar of source file windows to
see a list of the functions in that file.
• #pragma mark <yourLabel> // to mark things other than functions
• #pragma markOff // turn marking off until the end of the file or a #pragma markOn
• #pragma markOn // turn marking back on
Introduction
-----------
As you probably know, THINK C has facilities for marking interesting parts of source code. You can make a selection and hit command-M to mark it. From then on it will show up in a menu that you get at by Command-clicking in the title bar of THINK C window. What if you want to mark every function name in the file? You could be careful to mark each function as you type it in, but after some cuts and pastes, the markers can get confused, and take you to different parts of the file by mistake. Don’t ask me why. So you say, how can this be improved?
Enter Marker Control. It’s an Extension and Control Panel combination that runs under System 6.0.5 and newer (including System 7). If you're running System 7 or newer, changes made to the Control Panel will immediately affect the marking process. In System 6, they won't take effect until after you restart your Macintosh.
Marker Control parses C source files as you open them from within THINK C, and marks each function name it comes across (not the prototypes, only the actual function where it’s defined). It also marks any symbol you put after a #pragma mark <symbol>. Most files are marked in less than a second. You'll barely notice that marking is taking place. To check the marking, Command-click in the title bar of the source file’s window.
You can also control what segments of your code get marked with two #pragma directives. They are #pragme markOn and #pragma markOff. If you do a markOff, Marker will not mark anything until the end of the file is hit or until a markOn pragma is encountered.
The Controls
-----------
The check boxes in the Marker Control Control Panel and their meanings are as follows:
√ Save Window Positions
When this check box is on, windows opened in THINK C will be opened to the last place they were closed in while this feature was on. (Like MPW).
√ Marking On
When this check box is on, marking will take place. When it's off, no marking will happen. It only takes a few assembly instructions to determine the setting of this switch, so when it's off, almost no time is spent in my code, so there is no noticible slowdown when marking is off.
√ Mark in File Order
If this box is checked, marker will prepend a number to the function names so that they will be kept in file order. If it is unchecked, they will be shown without the numbers in alphabetical order.
√ Use Object Names
When this is checked, marker will prepend the class name of a method to the method's name (e.g. CWindow::Open). Other functions will be maked normally. When it is unchecked, no class names will be used.
√ Mark Only Files Ending With .c or .C
When this is checked, only files ending with the characters .c or .C will be parsed and marked. When it is not checked, all files will be parsed when they are opened.
√ Only Mark Files Newer Than: __ Hours or Days
Often it makes sense to only mark files that you are continually changing. You might mark the Think Class Library once using Marker (the Application version of this Control Panel available wherever you got this), and then only have files you change on a daily basis continually marked as you open them. It's a good idea to run all files in a project through the Marker application once before using this option to be sure all files are marked in the first place.
The Price
---------
The best thing about Marker is its price - only $49.95! OK, sorry, it’s FREE. You can use it, love it, hate it, or simply tease your friends with it, but by all means try it. If you feel like it, drop me a note or post card as to what you think or would like to see added to Marker. I’d appreciate it.
Is It Safe?
----------
I have been using this program to mark files in various projects I am working on, and have had no problems or lost data. However, since this is a Beta release, and you're never certain of bug-free code, if you find a bug, please try to reproduce it a few times and let me know exactly how to find it. If functions are not marked properly, or non functions are marked, send me the file that was marked improperly. If you want to remove any sensitive parts of it, that's fine, but be sure leave enough so the bug shows up! My address (electronic and otherwise) are at the end of this document.
Modification History:
-------------------
v0.1
Initial release.
v0.2
Fixed a problem in the marking routine. If a file contained an unterminated comment, the computer would hang.
Changed the patch from InitGraf to TEInit since InitGraf is not supposed to move memory while TEInit is allowed to. This was not really a problem before since several of the standard initialization routines move memory and since rarely is anything ever done before InitGraf that would be hurt if memory moved while in InitGraf. Still, since I may move memory in the patch, it's better to be safe than sorry.
v0.3
Added window location restoration. Now, when you close and reopen a window, it is opened to the location that it was last in. If the last location it was in does not exist on the hardware you are running (a friend gave you a file from his multi-monitor configuration), it will open to the default THINK C size and location.
Prettied up the Control Panel's appearance.
v0.4
Fixed an incompatibility with Super Boomerang's file text search by changing the method of identification of a file opening in THINK C.
v0.5
- Now Marker Control is ONLY compatible with THINK C 5.0.3 or better. (No, I didn't get to take much advantage of the new editor extensions. The information I need to obtain from THINK C isn't ready until after the scroll bars are put into place, and at that point, it's too late to resize the window. Oh well.)
- Added the Marker cursor to indicate when a file is being marked - let me know if you like this feature.
- Added two new #pragma's.
#pragma markOff turns off marking of functions for the rest of the file or until
#pragma markOn markOn is encountered.
- Now functions defined immediately after a #pragma are marked.
- Now something like
typedef mERR_code (* tUIProc) (void);
does not get marked.
- A problem with calling DisposHandle on a newly created resource handle is now fixed.
v0.6
- Fixed a bug where if you had the "Only Mark Files Newer Than:" option OFF and moved
a window without making any changes to it, it set the modified date of the associated
file to some time in the early 1900s.
- Made it so that window positions and sizes are saved even if you close the windows
with "Close All" or by quitting THINK C. Before, they were only saved if you actually
used "Close" from the File menu.
- Now functions that contain function prototypes as parameters are marked.
Known Bugs
----------
If a file's name has angle braces around it, e.g. "<OddlyNamed.c>" it will not get marked. This is not to be confused with files in the THINK C folder whose names do NOT have the braces around them. You probably never name your files with such braces anyway, but I thought I would let you know about this.
How To Reach Me
---------------
I love to get mail about this stuff. If you have ideas for improvement, found bugs, or just want to say hello, drop me a line.